<template>
	<view>
		<gt-form v-if="template.search" 
		:template="template.search"  
		:formData="template.searchFormData"
		:selectList="template['selectList']" 
		:defaultClass="template.class || 'gt-form-border row'"
		:defaultChildClass="template.defaultChildClass || 'gt-form-block-sm mr-10'"
		:defaultChildStyle="template.defaultChildStyle || ''"
		@submit="searchFormSubmit"></gt-form>
			
	</view>
	
</template>

<script>
	export default {
		name: "gt-admin-nav",
		model: {
			prop: 'template',
			event: 'change'
		},
		props: {
			template: {},
		},
		data() {
			return {}
		},
		watch:{
			template(n,o){
				console.log(n);
				
			}
		},
		methods: {
			searchFormSubmit(e){
				let temp = this.template;
				temp['searchFormData'] = {
					...temp['searchFormData'],
					...e.data
				};
				this.$emit('change',temp)
				this.$emit('clickBack',{
					type:'search'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	
</style>
